{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from ipywidgets import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**1.** `VBox(HBox)`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "VBox([HBox([VBox([Dropdown(description='Choice', options=['foo', 'bar']), \n",
    "                  ColorPicker(description='Color'), \n",
    "                  HBox([Button(), Button()])]), \n",
    "            Textarea(value=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit,\"\n",
    "\"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \"\n",
    "\"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris \"\n",
    "\"nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \"\n",
    "\"reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla \"\n",
    "\"pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa \"\n",
    "\"qui officia deserunt mollit anim id est laborum.\")]),\n",
    "      HBox([Text(), Checkbox(description='Check box')]), \n",
    "      IntSlider(), \n",
    "      Controller()], background_color='#EEE')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**2.** `HBox(VBox)`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "HBox([VBox([Button(description='Press'), Dropdown(options=['a', 'b']), Button(description='Button')]), \n",
    "      VBox([Button(), Checkbox(), IntText()])], background_color='#EEE')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**3.** `VBox(HBox)` width sliders, range sliders and progress bars"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "VBox([HBox([Button(), FloatRangeSlider(), Text(), Button()]), \n",
    "      HBox([Button(), FloatText(),\n",
    "            FloatProgress(value=40), Checkbox(description='Check')]), \n",
    "      HBox([ToggleButton(), IntSlider(description='Foobar'),\n",
    "            Dropdown(options=['foo', 'bar']), Valid()]),\n",
    "     ])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**4.** Dropdown resize"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dd = Dropdown(description='Foobar', options=['foo', 'bar'])\n",
    "dd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dd.layout.width = '148px'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp = ColorPicker(description='foobar')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**5.** Colorpicker alignment, concise and long version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "VBox([HBox([Dropdown(width='148px', options=['foo', 'bar']),\n",
    "            Button(description='Button')]), cp, HBox([Button(), Button()])])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.concise = True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp.concise = False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp2 = ColorPicker()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "VBox([HBox([Button(), Button()]), cp2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp2.concise = True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cp2.concise = False"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**6.** Vertical slider and progress bar alignment and resize"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "HBox([IntSlider(description='Slider', orientation='vertical', height='200px'),\n",
    "      FloatProgress(description='Progress', value=50, orientation='vertical', height='200px')])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "HBox([IntSlider(description='Slider', orientation='vertical'),\n",
    "      FloatProgress(description='Progress', value=50, orientation='vertical')])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**7.** Tabs\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "t = Tab(children=[FloatText(), IntSlider()], _titles={0: 'Text', 1: 'Slider'})\n",
    "t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "t.selected_index = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
